package com.vvv.shortlink.project.dao.mapper;


import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.vvv.shortlink.project.dao.entity.LinkDO;
import com.vvv.shortlink.project.dto.req.LinkPageReqDTO;
import com.vvv.shortlink.project.dto.resp.LinkGroupCountRespDTO;
import com.vvv.shortlink.project.dto.resp.LinkPageRespDTO;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
* @author Dell
* @description 针对表【t_link】的数据库操作Mapper
* @createDate 2024-02-02 10:21:57
* @Entity generator.domain.LinkDO
*/
public interface LinkMapper extends BaseMapper<LinkDO> {

    /**
     * 统计userId下面的个分组下面的短链接数量
     *
     * @param userId，用户id
     * @return gid,shortLinkCount
     */
    List<LinkGroupCountRespDTO> listShortLinkGroupCount(Long userId);

    /**
     * 分页统计短链接
     */
    IPage<LinkPageRespDTO> pageLink(@Param("requestParam") LinkPageReqDTO requestParam);
}




